﻿@model IEnumerable<Vizzio.Models.Cliente>

@{
    ViewBag.Title = "Buscar cliente";
}

<h2>Buscar Cliente</h2>

<form class="form-inline" method="post" action="/Cliente/Buscar/@ViewBag.SocioID" role="form">
    <div class="form-group">
        <label class="sr-only" for="Ci">CI</label>
        <input type="text" class="form-control" id="Ci" name="Ci" placeholder="Ci Cliente">
    </div>
    <div class="form-group">
        <label class="sr-only" for="Nombre">Nombre</label>
        <input type="text" class="form-control" id="Nombre" name="Nombre" placeholder="Nombre del Cliente">
    </div>
    <div class="form-group">
        <label class="sr-only" for="Apellidos">Apellidos</label>
        <input type="text" class="form-control" id="Apellidos" name="Apellidos" placeholder="Apellidos del Cliente">
    </div>
    <button type="submit" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search"></span> Buscar</button>
</form>
<p>
    @Html.ActionLink("Registrar cliente", "Create", "Cliente", new { id = @ViewBag.SocioID},null)
</p>
<table class=" table table-striped table-hover ">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.CI)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Nombre)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Apellidos)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Telefono)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Celular)
        </th>
        @*<th>
                Socio Proveedor
            </th>*@
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.CI)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Nombre)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Apellidos)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Telefono)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Celular)
            </td>
            @*<td>
                    @Html.DisplayFor(modelItem => item.Socio.Nombre)
                </td>*@
            <td>
                @Html.ActionLink("Editar", "Edit", new { id = item.ClienteID }) |
                @*@Html.ActionLink("Detalles", "Details", new { id=item.ClienteID }) |*@
                @Html.ActionLink("Eliminar", "Delete", new { id = item.ClienteID })
            </td>
        </tr>
    }

</table>

@Html.ActionLink("Volver a lista de Socios", "Index", "Socio")
